package com.woniuxy.homepage.core.controller;


import com.woniuxy.common.CommonResult;
import com.woniuxy.homepage.core.model.CarGoodsRecommend;
import com.woniuxy.homepage.core.service.CarGoodsRecommendService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author gmx
 * @since 2021-07-13
 */
@RestController
@RequestMapping("/carGoodsRecommend")
public class CarGoodsRecommendController {
    @Resource
    private CarGoodsRecommendService service;

    @GetMapping("selectRecommend")
    public CommonResult selectRecommend(){
        List<CarGoodsRecommend> list = this.service.selectRecommend();
        if (list == null){
            return CommonResult.fail("查询商品类型失败");
        }
        return CommonResult.success(list);
    }
}

